﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Dapper.IService;
using Dapper.Model;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace Dapper.WebApi
{
    [Route("api/[controller]/[action]")]
    public class OrderController : Controller
    {
        // GET: /<controller>/
        public IOrderService _orderService;
        public OrderController(IOrderService orderService)
        {
            this._orderService = orderService;
        }

        //[HttpGet]
        //public Order GetOrder(string Id)
        //{
        //    return _orderService.GetById(Id);
        //}

            [HttpGet]
        public Order GetOrder(string Id)
        {
            return _orderService.GetById(Id);
        }
    }
}
